<template>
  <div class="bg">
    <div class="layout">
      <div class="tabLayout">
        <div
          class="tabItem"
          @click="tabPosition = 0"
          :class="{ selceted: tabPosition == 0 }"
        >
          登陆
        </div>
        <div class="sep"></div>
        <div
          class="tabItem"
          @click="tabPosition = 1"
          :class="{ selceted: tabPosition == 1 }"
        >
          注册
        </div>
        <div class="sep"></div>
        <div
          class="tabItem"
          @click="tabPosition = 2"
          :class="{ selceted: tabPosition == 2 }"
        >
          忘记密码
        </div>
      </div>

      <LoginItem v-if="tabPosition == 0"></LoginItem>
      <RegisterItem v-else-if="tabPosition == 1"></RegisterItem>
      <ForgetItem v-else></ForgetItem>

      <div v-if="tabPosition == 0" class="forget" @click="tabPosition = 2">
        忘记密码？点击这里找回密码
      </div>
    </div>
  </div>
</template>

<script>
import LoginItem from "../components/login/LoginItem";
import RegisterItem from "../components/login/RegisterItem";
import ForgetItem from "../components/login/ForgetItem";

export default {
  name: "Login",
  components: {
    LoginItem,
    RegisterItem,
    ForgetItem,
  },
  data() {
    return {
      tabPosition: 0,
    };
  },
  created() {
 
  },
};
</script>

<style lang="scss" scoped>
* {
  cursor: pointer//鼠标悬浮变 "手";
}
.bg {
  width: 100vw;
  height: 100vh;
  background-image: url("../assets/login/bg.jpg");
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout {
  width: 500px;
  background: white;
  border-radius: 16px;
  height: 350px;
  display: flex;
  flex-direction: column;
  opacity: 0.95;
  .tabLayout {
    background: #1890ff;
    border-top-right-radius: 16px;
    border-top-left-radius: 16px;
    height: 44px;
    display: flex;
    flex-direction: row;
    .tabItem {
      flex: 1;
      color: white;
      font-size: 20px;
      font-weight: 800;
      text-align: center;
      line-height: 44px;
      height: 44px;
    }
    .selceted {
      background: cornflowerblue;
      color: blue;
    }
    .selceted:first-child {
      border-top-left-radius: 16px;
    }
    .selceted:last-child {
      border-top-right-radius: 16px;
    }
    .sep {
      width: 1px;
      height: 44px;
      background: white;
    }
  }
  .forget {
    font-size: 14px;
    color: grey;
    text-align: center;
    margin-top: 32px;
    cursor: pointer//鼠标悬浮变 "手";
  }
  .forget:hover {
    color: #1890ff;
  }
}
</style>